/**
 * @author whailong  [wanghl@ncsi.com.cn]
 * @date 16 Jun 2014 10:51:37
 */
package com.surent.controller.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;

import com.hailong.surent.R;
import com.lidroid.xutils.ViewUtils;
import com.surent.controller.activity.AtyLogin;

/**
 * 
 * @author whailong [wanghl@ncsi.com.cn]
 * @date 16 Jun 2014 10:51:37
 */
public class FragMine extends Fragment {
	private FragmentActivity atyParent;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		this.setHasOptionsMenu(true);
		return inflater.inflate(R.layout.frag_mine, null);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		atyParent = getActivity();
		ViewUtils.inject(this, atyParent);
	}

	@Override
	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
		inflater.inflate(R.menu.frag_mine, menu);
		super.onCreateOptionsMenu(menu, inflater);
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		if (item.getItemId() == R.id.item_menu_login) {
			startActivity(new Intent(atyParent, AtyLogin.class));
		}
		return super.onOptionsItemSelected(item);
	}
}
